package com.example.dyxeapplication.content.menu.alfabet;

import com.example.dyxeapplication.R;
import com.example.dyxeapplication.content.menu.alfabet.ear.Ear;
import com.example.dyxeapplication.content.menu.alfabet.eye.Eye;
import com.example.dyxeapplication.content.menu.alfabet.hand.Hands;
import com.example.dyxeapplication.content.menu.alfabet.lips.Lips;
import com.example.dyxeapplication.menu.Menu;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_AE;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_BD;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_CO;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_FT;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_GJY;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_HNR;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_IL;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_KX;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_MW;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_PQ;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_SZ;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet_UV;
import com.example.dyxeapplication.setting.temp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class Alfabet extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.menu_content_alfabet);

		Button eye = (Button) findViewById(R.id.iconeye);
		Button hand = (Button) findViewById(R.id.iconhand);
		Button ear = (Button) findViewById(R.id.iconear);
		Button lips = (Button) findViewById(R.id.iconlips);

		ImageView imgview = (ImageView) findViewById(R.id.recHandBesar);

		if (temp.huruf.equals("a")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.a);

		} else if (temp.huruf.equals("b")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.b);

		} else if (temp.huruf.equals("c")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.c);

		} else if (temp.huruf.equals("d")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.d);

		} else if (temp.huruf.equals("e")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.e);

		} else if (temp.huruf.equals("f")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.f);

		} else if (temp.huruf.equals("g")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.g);

		} else if (temp.huruf.equals("h")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.h);

		} else if (temp.huruf.equals("i")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.i);

		} else if (temp.huruf.equals("j")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.j);

		} else if (temp.huruf.equals("k")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.k);

		} else if (temp.huruf.equals("l")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.l);

		} else if (temp.huruf.equals("m")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.m);

		} else if (temp.huruf.equals("n")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.n);

		} else if (temp.huruf.equals("o")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.o);

		} else if (temp.huruf.equals("p")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.p);

		} else if (temp.huruf.equals("q")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.q);

		} else if (temp.huruf.equals("r")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.r);

		} else if (temp.huruf.equals("s")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.s);

		} else if (temp.huruf.equals("t")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.t);

		} else if (temp.huruf.equals("u")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.u);

		} else if (temp.huruf.equals("v")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.v);

		} else if (temp.huruf.equals("w")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.w);

		} else if (temp.huruf.equals("x")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.x);

		} else if (temp.huruf.equals("y")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.y);

		} else if (temp.huruf.equals("z")) {
			imgview = (ImageView) findViewById(R.id.a);
			imgview.setBackgroundResource(R.drawable.z);

		}

		eye.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent i = new Intent(Alfabet.this, Eye.class);
				i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				startActivity(i);
			}
		});

		hand.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent i = new Intent(Alfabet.this, Hands.class);
				i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				startActivity(i);
			}
		});

		ear.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent i = new Intent(Alfabet.this, Ear.class);
				i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				startActivity(i);
			}
		});

		lips.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent i = new Intent(Alfabet.this, Lips.class);
				i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				startActivity(i);
			}
		});
	}

	@Override
	public void onBackPressed() {
		if (temp.huruf.equals("a") || temp.huruf.equals("e")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_AE.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		} else if (temp.huruf.equals("b")||temp.huruf.equals("d")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_BD.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		} else if (temp.huruf.equals("c")||temp.huruf.equals("o")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_CO.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		} else if (temp.huruf.equals("f")||temp.huruf.equals("t")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_FT.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		}else if (temp.huruf.equals("g")||temp.huruf.equals("j")||temp.huruf.equals("y")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_GJY.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		}else if (temp.huruf.equals("h")||temp.huruf.equals("n")||temp.huruf.equals("r")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_HNR.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		}else if (temp.huruf.equals("i")||temp.huruf.equals("l")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_IL.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		}else if (temp.huruf.equals("k")||temp.huruf.equals("x")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_KX.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		}else if (temp.huruf.equals("m")||temp.huruf.equals("w")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_MW.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		}else if (temp.huruf.equals("p")||temp.huruf.equals("q")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_PQ.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		}else if (temp.huruf.equals("s")||temp.huruf.equals("z")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_SZ.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);

		}else if (temp.huruf.equals("u")||temp.huruf.equals("v")) {
			Intent myIntent = new Intent(this, Menu_Alfabet_UV.class);
			myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(myIntent);
		}
		
	}

	public void home(View v) {
		Intent myIntent = new Intent(this, Menu.class);
		myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(myIntent);
	}
}